home *** CD-ROM | disk | FTP | other *** search
/ NBC Slam Jams! / NBC Slam Jams!.iso / xtras / media_la / fx_set_1.fxm / 00131_Script_Text List < prev    next >
Text File  |  1998-01-20  |  2KB  |  70 lines

  1. property pElementList, pFieldName, pFieldSprite, pCurActive
  2.  
  3. on new me, proplist
  4.   set pElementList = getAProp(proplist,#list)
  5.   set pFieldName = getAProp(proplist,#textField)
  6.   set pFieldSprite = getAProp(proplist,#textSprite)
  7.   set pCurActive = getAProp(proplist,#cur)
  8.   
  9.   if not integerP(pCurActive) then put getPos(pElementList,pCurActive) into pCurActive
  10.   
  11.   populateList(me)
  12.   set the lineHeight of field pFieldName = the lineHeight of field pFieldName
  13.   if count(pElementList) > 0 then setActive(me,pCurActive)
  14.   else setActive(me,0)
  15.   return me
  16. end
  17.  
  18. on populateList me
  19.   put "" into text
  20.   repeat with i = 1 to count(pElementList)
  21.     put string(getAt(pElementList,i)) into line i of text
  22.   end repeat
  23.   put text into field pFieldName
  24. end
  25.  
  26. on setActive me, c
  27.   if not integer(c) then
  28.     put getPos(pElementList,c) into c
  29.   end if
  30.   
  31.   
  32.   if c >= 0 then
  33.     set pCurActive = c
  34.     
  35.     if c = 1 then put 1 into c1
  36.     else put the number of chars in line 1 to (c-1) of field pFieldName + 2 into c1
  37.     put the number of chars in line 1 to c of field pFieldName + 1 into c2
  38.     
  39.     hilite char c1 to c2 of field pFieldName
  40.   end if
  41.   
  42.   --  puppetSprite pHiliteSprite, TRUE
  43.   --  if pCurActive < 1 then
  44.   --    set the locV of sprite pHiliteSprite = -1000
  45.   --  else
  46.   --    put the rect of sprite pHiliteSprite into rec
  47.   --    put the lineHeight of field pFieldName into h
  48.   --    put the top of sprite pFieldSprite into th
  49.   --    set top = h*(pCurActive-1)+th+1-the scrolltop of member pFieldName
  50.   --    set bot = h*(pCurActive)+th+3-the scrolltop of member pFieldName
  51.   --    set top = max(top, th)
  52.   --    set bot = min(bot, the bottom of sprite pFieldSprite)
  53.   --    set the top of rec = top
  54.   --    set the bottom of rec = bot
  55.   --    set the rect of sprite pHiliteSprite = rec
  56.   --  end if
  57. end
  58.  
  59. on drag me
  60.   repeat while the stillDown
  61.     fieldClick(me,the mouseLine)
  62.   end repeat
  63.   return pCurActive
  64. end
  65.  
  66. on fieldClick me, c
  67.   if c > count(pElementList) then put count(pElementList) into c
  68.   setActive(me,c)
  69. end
  70.